Skip to content

feat!: adopt mod-utils v6 (mod-blocks v2)#147

Merged
markdumay merged 2 commits into
mainfrom
feat/mod-utils-v6
Jul 12, 2026
Merged

feat!: adopt mod-utils v6 (mod-blocks v2)#147
markdumay merged 2 commits into
mainfrom
feat/mod-utils-v6

Conversation

@markdumay

Copy link
Copy Markdown
Contributor

Adopts the mod-utils v6 validation engine as mod-blocks v2, per the adoption program (gethinode/mod-utils#334 and the v5-to-v6 migration notes in the mod-utils README).

Path bump

  • go.mod: module github.com/gethinode/mod-blocks/v2, requires github.com/gethinode/mod-utils/v6 v6.0.1 (contains the camelKey-collision fix; never v6.0.0)
  • config.toml and exampleSite/hugo.toml import paths updated; README install snippet updated
  • exampleSite carries no self-require pin (resolves through the mod-blocks.work workspace)

ExampleSite seeding (commit 1)

The exampleSite was a single placeholder page, so the argument engine validated nothing in CI. It now renders all 19 Bookshop components (one page per component under /components/, plus a hero on the home page), backed by demo blog posts, team members, a releases data file, a demo contact-form hook, and a Hinode import that provides the shared partials the components call at build time. Hinode v2.20.0 pins mod-utils/v5, but Hugo collects a single mod-utils module for the site and mod-blocks imports first, so the whole exampleSite runs on the v6 engine — the intended Hinode v3 endstate preview.

Migrated call sites (26 = every InitArgs/InitTypes site, commit 2)

  • 19 Bookshop wrappers (component-library/components/*/*.hugo.html): validation-only InitArgsArgs.html with "strict" false (CloudCannon/site-authored content); contact-form, list, and separator also read hook/id/clear from the $result.args envelope
  • 7 layout partials (utilities/section.html, assets/hero.html, assets/contact.html, assets/faq.html, assets/menu.html, assets/preview.html, assets/testimonial-carousel.html): Args.html + separated envelope, "strict" false (all receive site-authored content forwarded by the wrappers)

Call-site fixes carried by this generation

  • assets/menu.html: legacy $args.default defaulted-list read → the envelope's $result.defaulted
  • assets/hero.html: removed the dead or $args.linkType $args.link_type $args.type chain (only linkType exists in the envelope) and the dead or $args.heading.width 8 (v6 fills nested defaults)
  • assets/contact.html (or $args.width 12), assets/preview.html (device | default "desktop"), assets/testimonial-carousel.html (cols | default 1): dead fallbacks removed, engine defaults apply
  • faq.hugo.html: section component-name typo fawfaq (section class and params.modules.blocks.faq lookup were broken)

Verification

  • Root hugo mod graph: mod-utils/v6@v6.0.1 only; exampleSite graph contains no mod-utils/v5
  • pnpm build: exit 0, zero ERROR lines (before and after)
  • Visual regression (31 pages, seeded-v5 vs seeded-v6): 29 identical, 2 flagged (components/about, components/featured) — intended: illustration.width default 8 now applies to the omitted nested member, so the hero image wrapper gains col-8 and its sizes hint shrinks
  • Full HTML-source diff reduces to three mechanisms: the illustration.width/heading.width nested defaults now applying (hinode's section-title switches w-100col-12 col-md-8 on the flipped engine), the fawfaq fix, and pre-existing per-build md5 id churn (ids derive from now)

Warning triage (build log, all non-blocking)

  • [testimonials] testimonials[N]: unsupported attribute 'icon' — structure gap: the shared testimonials type in mod-utils _types.yml lacks icon, yet the blueprint declares it and assets/testimonial-carousel.html renders it. Flagged for maintainer; YAML deliberately untouched.
  • [video-message] video: unsupported attribute 'media_id' — structure gap: the shared video type declares id, while the blueprint and the wrapper use media_id/media-id. Flagged for maintainer; YAML deliberately untouched.
  • [script] state '', [image-definition] priority '', [hero-image] justify '', [bundle] modules []interface{} — hinode v2.20.0 internal call sites surfaced by the flipped v6 engine; hinode is out of scope for this program (wave 4 / Hinode v3).

Mixing this module into a site whose theme still pins mod-utils v5 flips that site's engine to v6 the same way (Hugo collects one mod-utils; first import wins) — release notes must call this out.

🤖 Generated with Claude Code

markdumay and others added 2 commits July 12, 2026 15:48
Extend the placeholder exampleSite so every Bookshop component is rendered
(and therefore validated by the argument engine) in CI: one content page per
component, demo blog posts and team members for the page-driven components,
a releases data file, a demo contact-form hook, and a Hinode import that
provides the shared partials the components call at site build time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump the module path to github.com/gethinode/mod-blocks/v2 and require
mod-utils v6.0.1. Migrate all 26 InitArgs call sites (19 Bookshop component
wrappers and 7 layout partials) to the Args API with the strict-false
guardrail for site-authored content. Remove fallbacks that v6 defaulting
makes dead (illustration and heading widths, device, cols, contact width,
legacy link_type chain) and fix the faq section component-name typo (faw).

BREAKING CHANGE: requires github.com/gethinode/mod-blocks/v2 import path; adopts
mod-utils v6 and migrates argument handling to the Args API (see gethinode/mod-utils
v5-to-v6 migration notes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@markdumay markdumay merged commit aaa4d7e into main Jul 12, 2026
8 checks passed
@markdumay

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant